@extends('layouts.default') @section('main')
    <link rel="stylesheet" href="/css/uniform.css" />
    <link rel="stylesheet" href="/css/select2.css" />
    <div id="content">
        <div id="content-header">
            <div id="breadcrumb">
                <a href="{{url('home')}}" title="返回首页" class="tip-bottom"><i class="icon-home"></i> 首页</a>
                <a href="{{url('user/index')}}" class="tip-bottom">用户管理</a>
                <a href="#" class="current">角色申请列表</a> </div>
        </div>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span12">
                    <form action="{{url('user/apply-search')}}" method="post">
                        <table>
                            <tr>
                                <th>
                                    <label >会员名 :</label>
                                </th>
                                <th>
                                    <div class="controls">
                                        <input type="text" class="span11" name="realname" value="" placeholder="会员名" />
                                    </div>
                                </th>
                                <th>
                                    <label >用户名 :</label>
                                </th>
                                <th>
                                    <div class="controls">
                                        <input type="text" class="span11" name="username" value="" placeholder="用户名" />
                                    </div>
                                </th>
                                <th>
                                    <label >申请原因 :</label>
                                </th>
                                <th>
                                    <div class="controls">
                                        <input type="text" class="span11" name="reason" value="" placeholder="申请原因" />
                                    </div>
                                </th>
                                <th>
                                    <label >申请的角色 :</label>
                                </th>
                                <th>
                                    <div class="controls">
                                        <select  name="apply_role" class="span11" >
                                            <option value="">请选择</option>
                                            <option value="2">普通会员</option>
                                            <option value="3">投资人</option>
                                            <option value="4">创客空间</option>

                                        </select>
                                    </div>
                                </th>
                                <th>
                                    <label >是否审核通过 :</label>
                                </th>
                                <th>
                                    <div class="controls">
                                        <select  name="status" class="span11" >
                                            <option value="">请选择</option>
                                            <option value="1">审核通过</option>
                                            <option value="0">待审核</option>
                                            <option value="-1">审核不通过</option>
                                        </select>
                                    </div>
                                </th>
                                <th>
                                    <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                    <div class="controls">
                                        <button type="submit" class="btn btn-info">查询</button>
                                    </div>
                                </th>
                            </tr>
                        </table>
                    </form>
                    <div class="widget-box">
                        <div class="widget-title"> <span class="icon"><i class="icon-th"></i></span>
                            <h5>会员角色申请列表</h5>
                        </div>
                        <div class="widget-content nopadding">
                            <table class="table table-bordered table-striped">
                                <thead>
                                <tr>
                                    <th>会员名</th>
                                    <th>用户名(username)</th>
                                    <th>申请的角色</th>
                                    <th>现角色</th>
                                    <th>申请原因</th>
                                    <th>申请时间</th>
                                    <th>用户详情</th>
                                    <th>审核状态</th>
                                    <th>审核</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach ($lists as $key => $list)
                                    <tr class="gradeX">
                                        <td>@if($list->user){{($list->user->realname)?$list->user->realname:$list->user->nickname}}@endif</td>
                                        <td>@if($list->user) {{$list->user->username}}@endif</td>
                                        <td>@if($list->role) {{$list->role->name}}@endif</td>
                                        <td>@if($list->user) {{$list->user->roleUser->role->name}}@endif</td>
                                        <td>{{$list->reason}}</td>
                                        <td>{{date('Y-m-d', strtotime($list->created_at->toDateTimeString()))}}</td>
                                        <td><a href="{{ url('user/info?uid='.$list->uid) }}" target="_blank">点击查看</a></td>
                                        <td>@if($list->status == 1)<i class="icon-ok"></i>@elseif($list->status == -1)<i class="icon-remove"></i>@elseif($list->status == 0)<i class="icon-question-sign"></i>@endif</td>
                                        <td class="center">
                                            @if(in_array('audit',$actions))<a data-original-title="审核" class="tip" href="{{url('user/edit-apply?id='.$list->id)}}"><i class="icon-pencil"></i></a>@endif
                                        </td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <?php echo $lists->appends(['username' => $username,'realname' => $realname,'reason' => $reason, 'apply_role' => $apply_role, 'status' => $status])->render();?>
                </div>
            </div>
        </div>
    </div>
    <script src="/js/matrix.tables.js"></script>
@stop

